<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>登录</title>
		<link rel="stylesheet" href="css/base.css" />
		<link rel="stylesheet" href="css/login.css" />
	</head>
	<body>
		<div class="login_header">
			<img src="/files/article/2018/09/21/1537532177482334266.jpg"/>
			<a href="#">
				初相遇 若重逢
			</a>
		</div>
		<div class="login_main">
			<div class="login_div">
				<h3>欢迎登陆<a class="login_register_a"><span>没有账号?</span>立即注册</a></h3>
				<div class="forum_div">
					<input type="text" placeholder="请输入您的账号" name="user_account" class="user_account" id="user_account" />
					<p class="error_tip">请输入正确的邮箱或手机号</p>
				</div>
				<div class="form-div">
					<input type="password" placeholder="6-16位密码,区分大小写，不能用空格" class="user_password" name="user_password" id="password" />
					<p class="error_tip"></p>
				</div>
				<div class="form-div">
					<button class="form-button">登录</button>
				</div>
			</div>
		</div>
		<script type="text/javascript" src="js/jquery.min.js" ></script>
		<script type="text/javascript">
			$(function(){
				$(".form-button").click(function(){
					$.post(
					"http://localhost:8080/campus/user/login.do",
					{"user_account":$("#user_account").val(),
					 "password":$("#password").val()
					},
					function(data){
						if(data=="登录成功"){
							$(window).attr("location","http://localhost:8080/campus/forum.html");
						}else{
							alert("账号或密码错误");
						}
					},
					"json"
				);
				});
			});
		</script>
	</body>
</html>
